//状态模式  有点像状态机的感觉
//用于从一个模式切换到另外一个模式
//状态模式的好处是  将与特定状态相关的行为局部化，并且将不同状态的行为分割开来
#ifndef __STATE_H__
#define __STATE_H__
#include <iostream>
#include <string>
#include <memory>
class Work;
class State
{
public:
    using ptr = std::shared_ptr<State>;
    //不同的行为进行状态的切换
    virtual void update(std::shared_ptr<Work> work) = 0;
};

class MorningState : public State
{
public:
    using ptr = std::shared_ptr<MorningState>;
    virtual void update(std::shared_ptr<Work> work) override;
};
class NoonState : public State
{
public:
    using ptr = std::shared_ptr<NoonState>;
    virtual void update(std::shared_ptr<Work> work) override;
};
class AfternoonState : public State
{
public:
    using ptr = std::shared_ptr<AfternoonState>;
    virtual void update(std::shared_ptr<Work> work) override;
};
class EveningState : public State
{
public:
    using ptr = std::shared_ptr<EveningState>;
    virtual void update(std::shared_ptr<Work> work) override;
};
class SleepState : public State
{
public:
    using ptr = std::shared_ptr<SleepState>;
    virtual void update(std::shared_ptr<Work> work) override;
};
#endif